package org.jiao.demo.core;

import java.text.DecimalFormat;

public class NumberTest {

	/**
	 * 保留一位小数
	 * @return
	 */
	private String getPercent(int a , int b){
		if(b==0)	return "";
		DecimalFormat df=new DecimalFormat("0.0");
		return df.format((float)a/b);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		NumberTest test = new NumberTest();
		System.out.println(test.getPercent(2, 3));

	}

}
